RiskClassControl
METADATA
Attribute | Value |
---|---|
Topic | 1630-client-book-risk |
MLink Token | ClientControl |
Product | SRControl |
accessType | SELECT,UPDATE,INSERT,DELETE |
Table Definition
Field | Type | Key | Default Value | Comment |
---|---|---|---|---|
accnt | VARCHAR(16) | PRI | '' | |
riskClass | VARCHAR(8) | PRI | '' | |
clientFirm | VARCHAR(16) | PRI | '' | SR client firm |
riskClassLabel | TINYTEXT | '' | risk class label | |
maxDDelta | INT | 250000 | maximum symbol absdelta suspends cp trading | |
minVaRs50 | INT | -50000 | xRM max loss underlier 50 | |
maxVaRs50 | INT | +50000 | xRM max gain underlier 50 | |
minVaRs15 | INT | -10000 | xRM max loss underlier 15 | |
maxVaRs15 | INT | +10000 | xRM max gain underlier 15 | |
minWtVega | INT | -1000 | xRM minimum symbol net wtVegawtVega ve vol sqrtmax01 years 4 | |
maxWtVega | INT | +1000 | xRM maximum symbol net wtVegawtVega ve vol sqrtmax01 years 4 | |
maxWtVePctM1 | FLOAT | 100 | of minmax symbol wtVega in M1 days 10 expirations | |
maxWtVePctM2 | FLOAT | 100 | of minmax symbol wtVega in M2 10 days 25 expirations | |
maxWtVePctM3 | FLOAT | 100 | of minmax symbol wtVega in M3 25 days 65 expirations | |
maxWtVePctM4 | FLOAT | 100 | of minmax symbol wtVega in M4 65 days 130 expirations | |
maxWtVePctM5 | FLOAT | 100 | of minmax symbol wtVega in M5 130 days expirations | |
modifiedBy | VARCHAR(24) | '' | user who last modified this record | |
modifiedIn | enum - SysEnvironment | 'None' | ||
timestamp | DATETIME(6) | '1900-01-01 00:00:00.000000' | timestamp of last modification |
PRIMARY KEY DEFINITION (Unique)
Field | Sequence |
---|---|
accnt | 1 |
riskClass | 2 |
clientFirm | 3 |
CREATE TABLE EXAMPLE QUERY
CREATE TABLE `SRControl`.`MsgRiskClassControl` (
`accnt` VARCHAR(16) NOT NULL DEFAULT '',
`riskClass` VARCHAR(8) NOT NULL DEFAULT '',
`clientFirm` VARCHAR(16) NOT NULL DEFAULT '' COMMENT 'SR client firm',
`riskClassLabel` TINYTEXT NOT NULL DEFAULT '' COMMENT 'risk class label',
`maxDDelta` INT NOT NULL DEFAULT 250000 COMMENT 'maximum symbol abs($delta) (suspends c/p trading)',
`minVaRs50` INT NOT NULL DEFAULT -50000 COMMENT '(xRM) max loss [underlier +/- 50%]',
`maxVaRs50` INT NOT NULL DEFAULT +50000 COMMENT '(xRM) max gain [underlier +/- 50%]',
`minVaRs15` INT NOT NULL DEFAULT -10000 COMMENT '(xRM) max loss [underlier +/- 15%]',
`maxVaRs15` INT NOT NULL DEFAULT +10000 COMMENT '(xRM) max gain [underlier +/- 15%]',
`minWtVega` INT NOT NULL DEFAULT -1000 COMMENT '(xRM) minimum symbol net wtVega;wtVega = ve * vol / sqrt(max(0.1, years * 4))',
`maxWtVega` INT NOT NULL DEFAULT +1000 COMMENT '(xRM) maximum symbol net wtVega;wtVega = ve * vol / sqrt(max(0.1, years * 4))',
`maxWtVePctM1` FLOAT NOT NULL DEFAULT 100 COMMENT '% of min/max symbol wtVega in M1 {days < 10} expirations',
`maxWtVePctM2` FLOAT NOT NULL DEFAULT 100 COMMENT '% of min/max symbol wtVega in M2 {10 < days < 25} expirations',
`maxWtVePctM3` FLOAT NOT NULL DEFAULT 100 COMMENT '% of min/max symbol wtVega in M3 {25 < days < 65} expirations',
`maxWtVePctM4` FLOAT NOT NULL DEFAULT 100 COMMENT '% of min/max symbol wtVega in M4 {65 < days < 130} expirations',
`maxWtVePctM5` FLOAT NOT NULL DEFAULT 100 COMMENT '% of min/max symbol wtVega in M5 {130 < days} expirations',
`modifiedBy` VARCHAR(24) NOT NULL DEFAULT '' COMMENT 'user who last modified this record',
`modifiedIn` ENUM('None','Neptune','Pluto','V7_Stable','V7_Latest','Saturn','Venus','Mars','SysTest','V7_Current') NOT NULL DEFAULT 'None',
`timestamp` DATETIME(6) NOT NULL DEFAULT '1900-01-01 00:00:00.000000' COMMENT 'timestamp of last modification',
PRIMARY KEY USING HASH (`accnt`,`riskClass`,`clientFirm`)
) ENGINE=SRSE DEFAULT CHARSET=LATIN1 COMMENT='';
SELECT TABLE EXAMPLE QUERY
SELECT
`accnt`,
`riskClass`,
`clientFirm`,
`riskClassLabel`,
`maxDDelta`,
`minVaRs50`,
`maxVaRs50`,
`minVaRs15`,
`maxVaRs15`,
`minWtVega`,
`maxWtVega`,
`maxWtVePctM1`,
`maxWtVePctM2`,
`maxWtVePctM3`,
`maxWtVePctM4`,
`maxWtVePctM5`,
`timestamp`
FROM `SRControl`.`MsgRiskClassControl`
WHERE
/* Replace with a VARCHAR(16) */
`accnt` = 'Example_accnt'
AND
/* Replace with a VARCHAR(8) */
`riskClass` = 'Example_riskClass'
AND
/* Replace with a VARCHAR(16) */
`clientFirm` = 'Example_clientFirm';
UPDATE TABLE EXAMPLE QUERY
UPDATE `SRControl`.`MsgRiskClassControl`
SET
/* Replace with a TINYTEXT */
`riskClassLabel` = 'dummy tiny text',
/* Replace with a INT */
`maxDDelta` = 5,
/* Replace with a INT */
`minVaRs50` = 5,
/* Replace with a INT */
`maxVaRs50` = 5,
/* Replace with a INT */
`minVaRs15` = 5,
/* Replace with a INT */
`maxVaRs15` = 5,
/* Replace with a INT */
`minWtVega` = 5,
/* Replace with a INT */
`maxWtVega` = 5,
/* Replace with a FLOAT */
`maxWtVePctM1` = 1.23,
/* Replace with a FLOAT */
`maxWtVePctM2` = 1.23,
/* Replace with a FLOAT */
`maxWtVePctM3` = 1.23,
/* Replace with a FLOAT */
`maxWtVePctM4` = 1.23,
/* Replace with a FLOAT */
`maxWtVePctM5` = 1.23,
/* Replace with a DATETIME(6) */
`timestamp` = '2022-01-01 12:34:56.000000'
WHERE
/* Replace with a VARCHAR(16) */
`accnt` = 'Example_accnt'
AND
/* Replace with a VARCHAR(8) */
`riskClass` = 'Example_riskClass'
AND
/* Replace with a VARCHAR(16) */
`clientFirm` = 'Example_clientFirm';
INSERT TABLE EXAMPLE QUERY
INSERT INTO `SRControl`.`MsgRiskClassControl`(
/* Replace with a VARCHAR(16) */
`accnt`,
/* Replace with a VARCHAR(8) */
`riskClass`,
/* Replace with a VARCHAR(16) */
`clientFirm`,
/* Replace with a TINYTEXT */
`riskClassLabel`,
/* Replace with a INT */
`maxDDelta`,
/* Replace with a INT */
`minVaRs50`,
/* Replace with a INT */
`maxVaRs50`,
/* Replace with a INT */
`minVaRs15`,
/* Replace with a INT */
`maxVaRs15`,
/* Replace with a INT */
`minWtVega`,
/* Replace with a INT */
`maxWtVega`,
/* Replace with a FLOAT */
`maxWtVePctM1`,
/* Replace with a FLOAT */
`maxWtVePctM2`,
/* Replace with a FLOAT */
`maxWtVePctM3`,
/* Replace with a FLOAT */
`maxWtVePctM4`,
/* Replace with a FLOAT */
`maxWtVePctM5`,
/* Replace with a DATETIME(6) */
`timestamp`
)
VALUES(
'Example_accnt',
'Example_riskClass',
'Example_clientFirm',
'dummy tiny text',
5,
5,
5,
5,
5,
5,
5,
1.23,
1.23,
1.23,
1.23,
1.23,
'2022-01-01 12:34:56.000000'
);
DELETE TABLE EXAMPLE QUERY
DELETE FROM `SRControl`.`MsgRiskClassControl`
WHERE
/* Replace with a VARCHAR(16) */
`accnt` = 'Example_accnt'
AND
/* Replace with a VARCHAR(8) */
`riskClass` = 'Example_riskClass'
AND
/* Replace with a VARCHAR(16) */
`clientFirm` = 'Example_clientFirm';
Doc Columns Query
SELECT * FROM SRControl.doccolumns WHERE TABLE_NAME='RiskClassControl' ORDER BY ordinal_position ASC;